package com.studerb.events;

import com.studerb.model.NewsGroup;

public class NewsGroupEvent {
    public enum EventType {
        ALL_REFRESHED, UPDATED, HEADERS
    }

    private EventType type;
    private Throwable throwable;
    private NewsGroup newsGroup;

    public NewsGroupEvent(EventType type) {
        this.type = type;
    }

    public NewsGroupEvent(EventType type, NewsGroup newsGroup) {
        this.type = type;
        this.newsGroup = newsGroup;
    }

    public NewsGroupEvent(EventType type, NewsGroup newsGroup, Throwable throwable) {
        this.type = type;
        this.newsGroup = newsGroup;
        this.throwable = throwable;
    }

    public NewsGroup getNewsGroup() {
        return newsGroup;
    }

    public Throwable getThrowable() {
        return throwable;
    }

    public EventType getType() {
        return type;
    }

}
